import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '评论小说',
    align: "center",
    dataIndex: 'bookName'
  },
  {
    title: '评论章节',
    align: "center",
    dataIndex: 'indexName'
  },
  {
    title: '评论内容',
    align: "center",
    dataIndex: 'commentContent'
  },
  {
    title: '评论时间',
    align: "center",
    dataIndex: 'createTime',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
  },
  {
    title: '评论人',
    align: "center",
    dataIndex: 'userName'
  },
  {
    title: '点赞数',
    align: "center",
    dataIndex: 'likeCount'
  },
  {
    title: '回复数量',
    align: "center",
    dataIndex: 'replyCount'
  },
];
columns.forEach(item=>{
  item.resizable=true
})
//评论列表数据
export const commentColumns: BasicColumn[] = [
  {
    title: '回复内容',
    align: "center",
    dataIndex: 'replyContent',
    ellipsis:false
  },
  {
    title: '回复人',
    align: "center",
    dataIndex: 'createUserName'
  },
  {
    title: '被回复人',
    align: "center",
    dataIndex: 'replyUserName'
  },
  {
    title: '点赞数',
    align: "center",
    dataIndex: 'likeCount'
  }, {
    title: '回复时间',
    align: "center",
    dataIndex: 'createTime'
  },
];
commentColumns.forEach(item=>{
  item.resizable=true
})
//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
